/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
define(["ojs/ojcore","knockout","signals","promise"],function(a,g,b){(function(){function c(){var a=window.location.href.split("#")[0];return a.substring(0,a.lastIndexOf("/"))}function d(a){var b={};a&&(a=a.split("\x26"),a.forEach(function(a){var c=a.split(/\=(.+)?/);a=c[0];a.length&&(b[a]||(b[a]=[]),c=c[1]&&decodeURIComponent(c[1].replace(/\+/g," ")),b[a].push(c))}));return b}function e(b,c){var d;c&&b.kt&&(a.p.Vq(c),b.kt.every(function(a){return a.Rl===c?(d=a,!1):!0}));return d}function f(){return window.location.href.split("#")[0].replace(J,
"")}function h(a){return a.Kq?h(a.Kq)+"."+a.hg:a.hg}function k(a){var b;if(a){if(b=k(a.Kq))b=(a=a.sh())?b+(a+"/"):void 0}else b="/";return b}function l(a,b){var c;a.Vi.every(function(a){return a.Lq&&a.Lq!==b?!0:(c=a,!1)});return c}function m(){return L[0]&&L[0].cancel}function r(b){var c=b.charAt(0);b=b.slice(1);if("0"===c)b=decodeURIComponent(b);else if("1"===c)b=a.G0.oHa(b);else throw Error("Error retrieving bookmarkable data. Format is invalid");return JSON.parse(b)}function t(b,c){if(c&&0<Object.getOwnPropertyNames(c).length){var d;
d=-1===b.indexOf("?")?"?":"\x26";var e=b,f=JSON.stringify(c),g=encodeURIComponent(f),f=a.G0.OGa(f),h=!1,k="oj_Router\x3d";f.length<=g.length&&(h=!0);k=h?k+("1"+f):k+("0"+g);if(1024<k.length)throw Error("Size of bookmarkable data is too big.");b=e+(d+k)}return b}function s(a,b,c){var d;a.Vi.every(function(a){return a.Lq&&a.Lq!==c||!a.Zn(b)?!0:(d=a,!1)});return d}function q(a){if(!a)return{title:"",gB:""};var b=q(l(a,a.sh()));if(""===b.title&&(a=a.GI())){var c=a.Qz;void 0!==c?("function"===typeof c&&
(c=c()),b.title=String(c)):(c=a.qV,void 0!==c&&(c=String(c),""!==b.gB&&(c+=" | "+b.gB),b.gB=c))}return b}function p(a,b){var c=[],d=[],e=a,f=b.split("/"),g,h,k;for(f.splice(0,1);e;)d.unshift(e),e=e.Kq;for(;g=f.shift();){e=d.shift();if(!e){if(e=s(h,g,k),!e){Y=b;break}}else if(!e.Zn(g))throw Error('Invalid path "'+b+'". State id "'+g+'" does not exist on router "'+e.hg+'".');c.push({ae:e,jB:g});h=e;k=g}e=!0;for(d=c.length-1;0<=d&&e;d--)c[d].jB===c[d].ae.Bo?c[d].jB=null:e=!1;return c}function n(b,c,
d){(b=b())||a.t.info("%s is false for state: %s",c,d);return b}function u(a,b,c,d){"function"===typeof a&&(b=b?b.then(function(b){b&&(b=n(a,c,d));return b}):new Promise(function(b){b(n(a,c,d))}));return b}function v(a,b){var c=a.GI(),d;if(c){for(d=0;d<a.Vi.length;d++)b=v(a.Vi[d],b);d=c.BO&&c.BO.canExit?c.BO.canExit:c.BC;b=u(d,b,"canExit",c.Rl)}return b}function w(b){if(m())return Promise.resolve(!1);a.t.info("Start _canExit.");b?(b=v(b,null),b=null===b?Promise.resolve(!0):b.then(function(a){return a&&
!m()})):b=Promise.resolve(!0);return b}function y(b,c){if(m())return Promise.resolve();a.t.info("Start _canEnter.");var d=null;b.forEach(function(a){(a=a.ae.Zn(a.value))&&(d=u(a.AC,d,"canEnter",a.Rl))});return d=null===d?Promise.resolve({TX:b,origin:c}):d.then(function(a){var d;a&&!m()&&(d={TX:b,origin:c});return d})}function x(b,c){var d=b.ae.Zn(b.ae.sh()),e=b.value?b.ae.Zn(b.value):void 0;return Promise.resolve().then(function(){a.t.info("Updating state of %s to %s.",h(b.ae),b.value)}).then(d?d.WC:
void 0).then(function(){var a=b.ae,d,e,f;if("popState"===c){e=a.vz.length;for(d=e-1;0<=d;d--)if(a.vz[d]===b.value){f=!0;a.vz.splice(d,e-d);break}1===e-d&&(a.dE="back")}f||(delete a.dE,a.vz.push(a.sh()));a.sh(b.value)}).then(e?e.VC:void 0)}function z(b){if(!b)return{hasChanged:!1};var c=Promise.resolve().then(function(){a.t.info("Entering _updateAll.");a.Jb.YL=!0});b.TX.forEach(function(a){c=c.then(function(){if(!m())return x(a,b.origin)})});return c.then(function(){var c=0<b.TX.length&&!m();a.Jb.YL=
!1;a.t.info("_updateAll returns %s.",String(c));return{hasChanged:c}},function(b){a.Jb.YL=!1;return Promise.reject(b)})}function C(b){var c={},d,e=b.split("?")[1]||"";a.t.info("Parsing: %s",b);b=H.mF(b);if(e=e.split("oj_Router\x3d")[1])e=e.split("\x26")[0],c=r(e);if(a.t.option("level")===a.t.Du)for(d in a.t.info("Bookmarkable data: "),c)a.t.info("   { router: %s, value: %s }",d,c[d]);b=H.parse(b).filter(function(a){var b=c[a.ae.hg];void 0!==b&&(a.ae.Nl=b);return a.value!==a.ae.sh()});a.t.option("level")===
a.t.Du&&(a.t.info("Potential changes are: "),b.forEach(function(b){a.t.info("   { router: %s, value: %s }",h(b.ae),b.value)}));return b}function E(a,b){var c;try{c=C(a)}catch(d){return Promise.reject(d)}return y(c,b).then(z)}function B(b){a.t.info("\x3e\x3e Executing: path\x3d%s, url\x3d%s, origin\x3d%s",b.path,b.url,b.origin);return void 0!==b.url?"sync"===b.origin?E(b.url):w(b.ae).then(function(a){return a?E(b.url,b.origin):{hasChanged:!1}}):b.ae.fwa(b.path||null,b.replace)}function K(){var b=L[0];
a.t.info("\x3e\x3e Resolving: path\x3d%s, url\x3d%s",b.path,b.url);b.cancel?(a.t.info("\x3e\x3e Cancelled: path\x3d%s, url\x3d%s",b.path,b.url),b=Promise.resolve({hasChanged:!1})):b=B(b);return b.then(function(b){var c=L.shift();a.t.info("\x3e\x3e Done with: path\x3d%s, url\x3d%s",c.path,c.url);if(!0===b.hasChanged){var c=q(F),d;""!==c.title?d=c.title:D&&0<D.length?(d=D,""!==c.gB&&(d+=" | "+c.gB)):d=c.gB;d!==window.document.title&&(window.document.title=d)}a.Jb.Tz.dispatch(b);return b},function(b){L=
[];a.t.error("Error when executing transition: %s",b.message);a.Jb.Tz.dispatch({hasChanged:!1});return Promise.reject(b)})}function I(b){var c;c=L.push(b);a.t.info("\x3e\x3e Queue transition for path\x3d%s, url\x3d%s",b.path,b.url);1===c?S=K():(b=L[c-2],b.url||b.qHa||(a.t.info("\x3e\x3e Cancelling: path\x3d%s",b.path),b.cancel=!0),S=S.then(K));return S}function Q(){var b,c,d=F.sh(),e=null;a.t.info("Handling popState event with URL: %s",window.location.href);if(d)for(b=0;b<F.Vi.length;b++)if(c=F.Vi[b],
d===c.Lq){e=c;break}I({ae:e,url:f(),origin:"popState"}).then(null,function(b){a.t.error("Error while changing state in handlePopState: %s",b.message)})}function A(){N||(H||(H=new a.Jb.S_),J||(J=c()),D=window.document.title,window.addEventListener("popstate",Q,!1),a.t.info("Initializing rootInstance."),a.t.info("Base URL is %s",J),a.t.info("This page is %s",M),a.t.info("Current URL is %s",window.location.href),N=!0)}var J,D,M=function(){var a="",b=window.location.pathname;-1!==b.indexOf(".html",b.length-
5)&&(a=b.split("/").pop());return a}(),H,N=!1,Y,L=[],S,F;a.Jb=function(a,b,c){var d=this;this.hg=a;this.Lq=c||(b?b.sh():void 0);this.Kq=b;this.Vi=[];this.Nl=void 0;this.sh=g.observable();this.MEa=g.pureComputed({read:function(){return this.sh()},write:function(a){this.go(a).then(null,function(a){throw a;})},owner:d});this.kt=null;this.Bo=void 0;this.GI=g.pureComputed(function(){return g.ignoreDependencies(d.Zn,d,[d.sh()])});this.Isa=g.pureComputed(function(){var a,b=g.ignoreDependencies(d.Zn,d,[d.sh()]);
b&&(a=b.value);return a});this.dE=void 0;this.vz=[];this.wAa=Object.create(null,{name:{value:g.pureComputed(function(){var a,b;b=this.sh()||this.Bo||this.kt[0];if(b=this.Zn(b))a=b.value,a&&"string"===typeof a||(a=b.Rl);return a},d),enumerable:!0},params:{value:Object.create(null,{ojRouter:{value:new function(){Object.defineProperties(this,{parentRouter:{value:d,enumerable:!0},direction:{get:function(){return d.dE},enumerable:!0}})},enumerable:!0}}),enumerable:!0},lifecycleListener:{value:Object.create(null,
{attached:{value:function(a){var b=g.unwrap(a.valueAccessor()).params.ojRouter.parentRouter.GI();b&&(b.BO=a.viewModel)},writable:!0,enumerable:!0}}),enumerable:!0}});Object.defineProperties(this,{parent:{value:this.Kq,enumerable:!0}})};o_("Router",a.Jb,a);Object.defineProperties(a.Jb.prototype,{name:{get:function(){return this.hg},enumerable:!0},states:{get:function(){return this.kt},enumerable:!0},stateId:{get:function(){return this.MEa},enumerable:!0},currentState:{get:function(){return this.GI},
enumerable:!0},currentValue:{get:function(){return this.Isa},enumerable:!0},defaultStateId:{get:function(){return this.Bo},set:function(a){this.Bo=a},enumerable:!0},moduleConfig:{get:function(){return this.wAa},enumerable:!0}});F=new a.Jb("root",void 0,void 0);a.Jb.prototype.fga=function(a){var b;a&&"string"===typeof a&&(a=a.trim(),0<a.length&&this.Vi.every(function(c){return c.hg===a?(b=c,!1):!0}));return b};a.b.g("Router.prototype.getChildRouter",{fga:a.Jb.prototype.fga});a.Jb.prototype.vfa=function(b,
c){var d,e;a.p.Vq(b);c=c||this.sh();b=encodeURIComponent(b.trim());for(d=0;d<this.Vi.length;d++){e=this.Vi[d];if(e.hg===b)throw Error('Invalid router name "'+b+'", it already exists.');if(e.Lq===c)throw Error('Cannot create more than one child router for parent state id "'+e.Lq+'".');}d=new a.Jb(b,this,c);this.Vi.push(d);return d};a.b.g("Router.prototype.createChildRouter",{vfa:a.Jb.prototype.vfa});a.Jb.prototype.Zn=function(a){return e(this,a)};a.Jb.prototype.pfa=function(b){this.sh(void 0);delete this.Bo;
this.dE=void 0;this.vz=[];"function"===typeof b?(this.kt=null,this.Zn=b):(this.kt=[],delete this.Zn,Object.keys(b).forEach(function(c){var d=b[c];this.kt.push(new a.Lx(c,d,this));"boolean"===typeof d.isDefault&&d.isDefault&&(this.Bo=c)},this));return this};a.b.g("Router.prototype.configure",{pfa:a.Jb.prototype.pfa});a.Jb.prototype.Vga=function(a){return this.Zn(a)};a.b.g("Router.prototype.getState",{Vga:a.Jb.prototype.Vga});a.Jb.prototype.go=function(a){A();return I({ae:this,path:a,origin:"go"})};
a.b.g("Router.prototype.go",{go:a.Jb.prototype.go});a.Jb.prototype.fwa=function(b,c){function d(b){return b?E(g).then(function(b){if(b.hasChanged){var d=J+g;a.t.info("%s URL to %s",c?"Replacing":"Pushing",d);window.history[c?"replaceState":"pushState"](null,"",d)}return b}):{hasChanged:!1}}var e,g,n;e=!0;if(b)if("string"===typeof b)0<b.length&&(e=!1);else return Promise.reject(Error("Invalid object type for state id."));if(e&&(b=this.Bo||null,!b))return a.t.option("level")===a.t.Du&&a.t.info("Undefined state id with no default id on router %s",
h(this)),Promise.resolve({hasChanged:!1});if("/"===b.charAt(0))e=b;else{e=k(this.Kq);if(!e)return Promise.reject(Error('Invalid path "'+b+'". The parent router does not have a current state.'));e+=b}a.t.info("Destination path: %s",e);try{n=p(this,e)}catch(u){return Promise.reject(u)}g=H.efa(n);a.t.option("level")===a.t.Du&&a.t.info("Going to URL %s on router %s",g,h(this));n=H.mF(f());return c||H.mF(g)!==n?(a.t.info("Deferred mode or new URL is different."),w(this).then(d)):Promise.resolve({hasChanged:!1})};
a.Jb.prototype.kka=function(a){this.Nl=a;a={};for(var b=this;b;)void 0!==b.Nl&&(a[b.hg]=b.Nl),b=b.Kq;for(var b=this,c,d,e;b;){for(d=0;d<b.Vi.length;d++)if(e=b.Vi[d],b.sh()&&b.sh()===e.Lq){void 0!==e.Nl&&(a[e.hg]=e.Nl);c=e;break}b=c;c=void 0}c=J+H.mF(f());c=t(c,a);window.history.replaceState(null,"",c)};a.b.g("Router.prototype.store",{kka:a.Jb.prototype.kka});a.Jb.prototype.Lja=function(){return this.Nl};a.b.g("Router.prototype.retrieve",{Lja:a.Jb.prototype.Lja});a.Jb.prototype.gA=function(){for(var b,
c;0<this.Vi.length;)this.Vi[0].gA();if(this.Kq){b=this.Kq.Vi;for(c=0;c<b.length;c++)if(b[c].hg===this.hg){b.splice(c,1);break}delete this.Lq}else J="",H={},this.hg="root",window.document.title=D,window.removeEventListener("popstate",Q),a.Jb.Tz.removeAll(),N=!1;delete this.dE;this.vz=[];this.kt=null;delete this.Bo;delete this.Nl};a.b.g("Router.prototype.dispose",{gA:a.Jb.prototype.gA});a.Jb.Tz=new b.Signal;a.Jb.YL=!1;Object.defineProperties(a.Jb,{rootInstance:{value:F,enumerable:!0},transitionedToState:{value:a.Jb.Tz,
enumerable:!0}});a.Jb.Xc={};o_("Router.defaults",a.Jb.Xc,a);Object.defineProperties(a.Jb.Xc,{urlAdapter:{get:function(){H||(H=new a.Jb.S_);return H},set:function(a){if(N)throw Error("Incorrect operation. Cannot change URL adapter after calling sync() or go().");H=a},enumerable:!0,gO:!1},baseUrl:{get:function(){J||(J=c());return J},set:function(a){if(N)throw Error("Incorrect operation. Cannot change base URL after calling sync() or go().");J=a.replace(/\/$/,"")},enumerable:!0,gO:!1},rootInstanceName:{get:function(){return F.hg},
set:function(b){if(N)throw Error("Incorrect operation. Cannot change the name of the root instance after calling sync() or go().");a.p.Vq(b);F.hg=encodeURIComponent(b.trim())},enumerable:!0,gO:!1}});a.Jb.Nr=function(){var b;A();a.t.info("Entering sync.");if(Y)return b={ae:F,path:Y,qHa:!0,replace:!0},Y=void 0,I(b);if(a.Jb.YL)return a.t.info("Sync called while updating, waiting for updates to end."),new Promise(function(b){a.Jb.Tz.addOnce(function(c){a.t.info("Sync updates done.");b(c)})});b={ae:F,
url:f(),origin:"sync"};return I(b)};o_("Router.sync",a.Jb.Nr,a);a.Jb.S_=function(){this.parse=function(a){var b=F;a=a.split("/");var c=[],d;a.shift();do(d=a.shift())&&(0===d.length||/\.html$/i.test(d))&&(d=void 0),d=d||b.Bo,c.push({value:d,ae:b}),b=l(b,d);while(b);return c};this.efa=function(b){var c="",d={};b.forEach(function(a){a.jB&&(c+="/"+a.jB);void 0!==a.ae.Nl&&(d[a.ae.hg]=a.ae.Nl)});""===c&&(c="/"+M);try{c=t(c,d)}catch(e){a.t.error("Error while building URL: %s",e)}return c};this.mF=function(a){return a.split("?")[0]};
this.Hga=function(a){var b=a.indexOf("?"),c=null;-1!==b&&(c=a.substr(b+1));return d(c)}};o_("Router.urlPathAdapter",a.Jb.S_,a);a.Jb.dMa=function(){this.parse=function(a){a=this.Hga(a);var b=F,c=[],d;do{if(d=a[b.hg])d=d[0],delete a[b.hg];d=d||b.Bo;c.push({value:d,ae:b});b=l(b,d)}while(b);return c};this.efa=function(b){var c="/"+M,d={},e="?";b.forEach(function(a){a.jB&&(c+=e+a.ae.hg+"\x3d"+a.jB,e="\x26");void 0!==a.ae.Nl&&(d[a.ae.hg]=a.ae.Nl)});try{c=t(c,d)}catch(f){a.t.error("Error while building URL: %s",
f)}return c};this.mF=function(a){var b=a.indexOf("oj_Router\x3d");return-1!==b?a.substr(0,b-1):a};this.Hga=function(a){var b=a.indexOf("?"),c=null,c={};-1!==b&&(c=a.substr(b+1),c=d(c));return c}};o_("Router.urlParamAdapter",a.Jb.dMa,a);return F})();(function(){a.Lx=function(b,d,e){d=d||{};a.p.Vq(b);this.Rl=encodeURIComponent(b.trim());(this.AC=d.canEnter)&&a.p.Zz(this.AC);(this.VC=d.enter)&&a.p.Zz(this.VC);(this.BC=d.canExit)&&a.p.Zz(this.BC);(this.WC=d.exit)&&a.p.Zz(this.WC);this.Iea=d.value;this.qV=
d.label;this.Qz=d.title;this.kL=e;this.BO=void 0;Object.defineProperties(this,{id:{value:this.Rl,enumerable:!0},value:{get:function(){return this.Iea},set:function(a){this.Iea=a},enumerable:!0},label:{get:function(){return this.qV},set:function(a){this.qV=a},enumerable:!0},title:{get:function(){return this.Qz},set:function(a){this.Qz=a},enumerable:!0},canEnter:{get:function(){return this.AC},set:function(a){this.AC=a},enumerable:!0},enter:{get:function(){return this.VC},set:function(a){this.VC=a},
enumerable:!0},canExit:{get:function(){return this.BC},set:function(a){this.BC=a},enumerable:!0},exit:{get:function(){return this.WC},set:function(a){this.WC=a},enumerable:!0}})};o_("RouterState",a.Lx,a);a.Lx.prototype.go=function(){return this.kL?this.kL.go(this.Rl):(a.Jb.Tz.dispatch({hasChanged:!1}),Promise.reject(Error("Router is not defined for this RouterState object.")))};a.b.g("RouterState.prototype.go",{go:a.Lx.prototype.go});a.Lx.prototype.Rha=function(){if(!this.kL)throw Error("Router is not defined for this RouterState object.");
return this.kL.sh()===this.Rl};a.b.g("RouterState.prototype.isCurrent",{Rha:a.Lx.prototype.Rha})})();(function(){function b(a,c){if(null===a)return"";var d,e,f={},g={},h="",p=2,n=3,u=2,v="",w=0,y=0,x,z,C,E=a.length;for(C=0;C<E;C++)if(x=a[C],Object.prototype.hasOwnProperty.call(f,x)||(f[x]=n++,g[x]=!0),z=h+x,Object.prototype.hasOwnProperty.call(f,z))h=z;else{if(Object.prototype.hasOwnProperty.call(g,h)){if(256>h.charCodeAt(0)){for(d=u;d--;)w<<=1,5==y?(y=0,v+=c(w),w=0):y++;e=h.charCodeAt(0);d=8}else{e=
1;for(d=u;d--;)w=w<<1|e,5==y?(y=0,v+=c(w),w=0):y++,e=0;e=h.charCodeAt(0);d=16}for(;d--;)w=w<<1|e&1,5==y?(y=0,v+=c(w),w=0):y++,e>>=1;p--;0==p&&(p=Math.pow(2,u),u++);delete g[h]}else for(e=f[h],d=u;d--;)w=w<<1|e&1,5==y?(y=0,v+=c(w),w=0):y++,e>>=1;p--;0==p&&(p=Math.pow(2,u),u++);f[z]=n++;h=String(x)}if(""!==h){if(Object.prototype.hasOwnProperty.call(g,h)){if(256>h.charCodeAt(0)){for(d=u;d--;)w<<=1,5==y?(y=0,v+=c(w),w=0):y++;e=h.charCodeAt(0);d=8}else{e=1;for(d=u;d--;)w=w<<1|e,5==y?(y=0,v+=c(w),w=0):
y++,e=0;e=h.charCodeAt(0);d=16}for(;d--;)w=w<<1|e&1,5==y?(y=0,v+=c(w),w=0):y++,e>>=1;p--;0==p&&(p=Math.pow(2,u),u++);delete g[h]}else for(e=f[h],d=u;d--;)w=w<<1|e&1,5==y?(y=0,v+=c(w),w=0):y++,e>>=1;p--;0==p&&u++}e=2;for(d=u;d--;)w=w<<1|e&1,5==y?(y=0,v+=c(w),w=0):y++,e>>=1;for(;;)if(w<<=1,5==y){v+=c(w);break}else y++;return v}function d(a,b){for(var c=[],d=4,f=4,g=3,h="",p="",n,u,v,w,y,x={val:b(0),position:32,index:1},p=0;3>p;p+=1)c[p]=p;h=0;v=Math.pow(2,2);for(w=1;w!=v;)u=x.val&x.position,x.position>>=
1,0==x.position&&(x.position=32,x.val=b(x.index++)),h|=(0<u?1:0)*w,w<<=1;switch(h){case 0:h=0;v=Math.pow(2,8);for(w=1;w!=v;)u=x.val&x.position,x.position>>=1,0==x.position&&(x.position=32,x.val=b(x.index++)),h|=(0<u?1:0)*w,w<<=1;y=e(h);break;case 1:h=0;v=Math.pow(2,16);for(w=1;w!=v;)u=x.val&x.position,x.position>>=1,0==x.position&&(x.position=32,x.val=b(x.index++)),h|=(0<u?1:0)*w,w<<=1;y=e(h);break;case 2:return""}for(n=p=c[3]=y;;){if(x.index>a)return"";h=0;v=Math.pow(2,g);for(w=1;w!=v;)u=x.val&x.position,
x.position>>=1,0==x.position&&(x.position=32,x.val=b(x.index++)),h|=(0<u?1:0)*w,w<<=1;switch(y=h){case 0:h=0;v=Math.pow(2,8);for(w=1;w!=v;)u=x.val&x.position,x.position>>=1,0==x.position&&(x.position=32,x.val=b(x.index++)),h|=(0<u?1:0)*w,w<<=1;c[f++]=e(h);y=f-1;d--;break;case 1:h=0;v=Math.pow(2,16);for(w=1;w!=v;)u=x.val&x.position,x.position>>=1,0==x.position&&(x.position=32,x.val=b(x.index++)),h|=(0<u?1:0)*w,w<<=1;c[f++]=e(h);y=f-1;d--;break;case 2:return p}0==d&&(d=Math.pow(2,g),g++);if(c[y])h=
c[y];else if(y===f)h=n+n[0];else return null;p+=h;c[f++]=n+h[0];d--;n=h;0==d&&(d=Math.pow(2,g),g++)}}a.G0={OGa:function(a){return null===a?"":b(a,function(a){return f.charAt(a)})},oHa:function(a){return null===a?"":""===a?null:d(a.length,function(b){var c=f;b=a.charAt(b);var d;g||(g={});if(!g[c])for(g[c]={},d=0;d<c.length;d++)g[c][c[d]]=d;return g[c][b]})}};var e=String.fromCharCode,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",g})()});